/**
 * @version $Id$
 */
package org.spacegame.common;

import java.io.Serializable;

/**
 * TODO Describe the type.
 * 
 * @author vincent
 * 
 */
public class EntityState implements Serializable {

	/**
	 * TODO Describe the field.
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * The time stamp at which this information is valid.
	 */
	private final long timestamp;

	/**
	 * The x and y coordinates of the position
	 */
	private final int xPosition;

	private final int yPosition;

	/**
	 * The orientation (rotation) of the entity in degrees.
	 */
	private final int orientation;

	/**
	 * The velocity in x and y direction of the entity.
	 * 
	 * e.g.: Every second, the x and y position will be changing by the amount
	 * of x and y velocity.
	 */
	private final int xVelocity;

	private final int yVelocity;

	/**
	 * TODO Describe the constructor.
	 */
	public EntityState(final long timestamp, final int xPosition, final int yPosition, final int orientation, final int xVelocity,
			final int yVelocity) {
		this.timestamp = timestamp;
		this.xPosition = xPosition;
		this.yPosition = yPosition;
		this.orientation = orientation;
		this.xVelocity = xVelocity;
		this.yVelocity = yVelocity;
	}

	/**
	 * @return the orientation
	 */
	public int getOrientation() {
		return orientation;
	}

	/**
	 * @return the timestamp
	 */
	public long getTimestamp() {
		return timestamp;
	}

	/**
	 * @return the xPosition
	 */
	public int getxPosition() {
		return xPosition;
	}

	/**
	 * @return the xVelocity
	 */
	public int getxVelocity() {
		return xVelocity;
	}

	/**
	 * @return the yPosition
	 */
	public int getyPosition() {
		return yPosition;
	}

	/**
	 * @return the yVelocity
	 */
	public int getyVelocity() {
		return yVelocity;
	}

	@Override
	public String toString() {
		final StringBuilder builder = new StringBuilder();
		builder.append("EntityState [");
		builder.append("timestamp=").append(timestamp);
		builder.append(", xPosition=").append(xPosition);
		builder.append(", yPosition=").append(yPosition);
		builder.append(", orientation=").append(orientation);
		builder.append(", xVelocity=").append(xVelocity);
		builder.append(", yVelocity=").append(yVelocity);
		builder.append("]");
		return builder.toString();
	}

}
